package test2;

import java.util.LinkedList;
import java.util.Queue;

public class demo107 {
/*
* 轮转数组
* 拷贝一份数组，(k+i)%len 下标轮换拷贝数组的元素即可
*
* [1,2,3,4,5,6,7]                len = 7     k = 3
*  0 1 2 3 4 5 6            i = 0         (k+i)%len = 3%7 = 3
*
* 填表为
*
*        1
*        1 2
*        1 2 3
*        1 2 3 4
*      7 1 2 3 4
*    6 7 1 2 3 4
*  5 6 7 1 2 3 4
*
* */
/*    class Solution {
        public void rotate(int[] nums, int k) {
            int[] clone = nums.clone();
            int len = nums.length;
            for(int i = 0;i<len;i++)
            {
                nums[(k+i)%len] = clone[i];
            }
        }
    }*/
}
